/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pingouin;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Hippolyte
 */
public class TClientDebut extends Thread {

    @Override
    public void run() {

        PrintWriter pred = null;
        try {

            System.out.println("connexion a l'hote " + Partie.adresseServeur + "...");

            Socket socket = new Socket(Partie.adresseServeur, TServeurDebut.PORT);
            
            System.out.println("...connecté");

            pred = new PrintWriter(
                    new BufferedWriter(
                    new OutputStreamWriter(socket.getOutputStream())),
                    true);

            pred.println("youhou");
            pred.close();
            socket.close();
        } catch (IOException ex) {
            Logger.getLogger(TClientCoord.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
